//
//  RAcell.m
//  UESTCPioneer
//
//  Created by Cindy on 14-6-17.
//  Copyright (c) 2014年 Sway. All rights reserved.
//

#import "RAcell.h"

@implementation RAcell

-(UIImageView *)oneImg{
    if (!_oneimgView) {
        UIImage *xl = [UIImage imageNamed:@"xiala1"];
        _oneimgView = [[UIImageView alloc] initWithImage:xl];
        _oneimgView.frame = CGRectMake(10, 10, 20, 20);
    }
    
    return _oneimgView;
}

-(UIImageView *)twoImg{
    if (!_twoimgView) {
        UIImage *xl = [UIImage imageNamed:@"xiala1"];
        _twoimgView = [[UIImageView alloc] initWithImage:xl];
        _twoimgView.frame = CGRectMake(20, 10, 20, 20);
    }
    
    return _twoimgView;
}
- (void)showOneImg{
    [self.contentView addSubview:[self oneImg]];
}
- (void)showTwoImg{
    [self.contentView addSubview:[self twoImg]];
}

- (void)hideOneImg{
    if (self.oneimgView) {
//        [self.oneimgView removeFromSuperview];
        UIImage *xl2 = [UIImage imageNamed:@"xiala1"];
        self.oneimgView.image = xl2;
    }
}
- (void)hideTwoImg{
    if (self.twoimgView) {
//        [self.twoimgView removeFromSuperview];
        UIImage *xl2 = [UIImage imageNamed:@"xiala1"];
        self.twoimgView.image = xl2;
    }
}

- (void)tapDown {
    // twist down (expand)
    [UIImageView beginAnimations:@"Rotate Down" context:nil];
    [UIImageView setAnimationDuration:0.2];
    self.oneimgView.transform = CGAffineTransformMakeRotation(M_PI*2.5);
    [UIImageView commitAnimations];
    
}

- (void)tapDown2 {
    // twist down (expand)
    [UIImageView beginAnimations:@"Rotate Down" context:nil];
    [UIImageView setAnimationDuration:0.2];
    self.twoimgView.transform = CGAffineTransformMakeRotation(M_PI*2.5);
    [UIImageView commitAnimations];
}

- (void)tapUp {
    // twist up (collapse)
    [UIImageView beginAnimations:@"rotateDisclosureButt" context:nil];
    [UIImageView setAnimationDuration:0.2];
    self.oneimgView.transform = CGAffineTransformMakeRotation(M_PI*2);
    [UIImageView commitAnimations];
}



- (void)tapUp2 {
    // twist up (collapse)
    [UIImageView beginAnimations:@"rotateDisclosureButt" context:nil];
    [UIImageView setAnimationDuration:0.2];
    self.twoimgView.transform = CGAffineTransformMakeRotation(M_PI*2);
    [UIImageView commitAnimations];
}


- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)awakeFromNib
{
    // Initialization code
}




- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
